<!--
  @author tanghongjun
  @since 2018/10/19 08:59
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">

<head th:include="common/common :: jscss2">
    <title>渠道库存</title>
</head>
<body>

<div class="layui-fluid">
    <blockquote class="layui-crumb">
        渠道管理>
        <a lay-href="/channel/list.action">渠道管理</a>>
        <a th:href="'/channel/detail.action?channelId='+${obj.channelId}">[[${obj.name}]]</a>>
        <zmn th:text="订单库存">订单库存</zmn>
    </blockquote>
    <div class="layui-card">
        <div th:replace="channel/_tab::tab"></div>

        <fieldset class="layui-elem-field">
            <div class="layui-field-box" style="color: #9F9F9F;">
                未配置渠道库存，表示渠道库存走统一库存；若二级渠道的开通分类未设置，则此处将继承上级渠道配置；修改后会有5分钟缓存
            </div>
        </fieldset>

        <form method="post" action="/channel/config/list.action" id="product_list">
            <input type="hidden" name="channelId" th:value="${query.channelId}"/>
            <input type="hidden" name="pageSize" th:value="${query.pageSize}"/>
            <div class="layui-form" th:include="orderconfig/orderstock/channel/_query :: query "></div>
        </form>

        <div class="layui-card-body">
            <div th:if="${!stockLimit}" th:replace="orderconfig/orderstock/channel/_table::table"></div>
            <div th:if="${stockLimit}">因渠道方原因，此渠道，不受库存限制！</div>
            <script type="text/html" id="zmn-table-tool">
                <div class="layui-btn-container">
                    <div class="layui-btn-group">
                        <button th:if="${#authPermit.checkPermit('/channel/config/batchClose.action')}" class="layui-btn layui-btn-sm layui-btn-danger" lay-event="batchClose">批量关闭</button>
                    </div>
                    <div class="layui-btn-group">
                        <button th:if="${#authPermit.checkPermit('/channel/config/batchOpen.action')}" class="layui-btn layui-btn-sm" lay-event="batchOpen">批量开启</button>
                    </div>
                </div>
            </script>
        </div>

    </div>

</div>
</body>
</html>
<script type="text/javascript" th:inline="javascript">

    var json = {
        totalCount: [[${query.totalCount}]],
        pageSize: [[${query.pageSize}]],
        pageIndex: [[${query.pageIndex}]],
        query: [[${query}]],
        servCategList: [[${servCategList}]],
        categOneList: [[${categOneList}]],
        categTwoList: [[${categTwoList}]]
    };

    layui.config({
        version: 202003191042,
        base: "/static/lay/"
    }).extend({
        index: "lib/index",
        channelconfig_list_js: "orderconfig/orderstock/channel/zmn.scm.orderstock.channelconfig.list",
    }).use(['index', 'channelconfig_list_js']);

</script>